#include <bits/stdc++.h>
using namespace std;
int a[100001], x[100001], f[100001];
int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    int n, ans = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    int cnt = 1, t = 0;
    for (int i = 2; i <= n; i++)
    {
        if (a[i] != a[i - 1])
        {
            x[++t] = cnt;
            cnt = 1;
        }
        else
        {
            cnt++;
        }
    }
    x[++t] = cnt;
    for (int i = 1; i <= t; i++)
    {
        f[i] = x[i];
    }
    for (int i = 1, j = 2; i <= t && j <= t; i++)
    {
        for (j = max(j, i + 1); j <= t; j++)
        {
            if (f[j] >= x[i])
            {
                f[j] -= x[i];
                x[i] = 0;
                break;
            }
            else
            {
                x[i] -= f[j];
                f[j] = 0;
            }
        }
    }
    for (int i = 1; i <= t; i++)
    {
        ans += x[i];
    }
    cout << ans << endl;
    return 0;
}
